package com.sshc625.core {

	/**
	 * @author sshc625
	 */
	import com.sshc625.core.IBaseObject;

	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;

	public class BaseObject implements IBaseObject {
		/**
		 * get the class name of the object
		 */
		public function getClassName():String {
			return getQualifiedClassName( this );
		}

		/**
		 * get the class of the object, which can be used in the reflection
		 */
		public function getClass():Class {
			return Class( getDefinitionByName( getClassName()));
		}

		/**
		 * check another object is equal to the current one
		 */
		public function equals( obj:Object ):Boolean {
			return this == obj;
		}

		/**
		 * 
		 */
		public function dispose():void {
			throw new Error("should be override by subclass");		 
		}

		public function toString():String {
			return "[" + getClassName() + "]";
		}
	}
}